<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
			<button id = "btn1">点击我右击</button>
			<script type="text/javascript">
				//这一步是为了阻止右击时系统默认的弹出框
				document.getElementById("btn1").oncontextmenu = function(e){
			        e.preventDefault(   哈哈哈);
			    };
			   哈哈哈
				document.getElementById("btn1").onmouseup=function(oEvent) {
				    if (!oEvent) oEvent=window.event;
				    if (oEvent.button==2) {
				        console.log('鼠标右击了')
				    }
				}
			</script>

	</body>
</html>
